class Monkey:
    def __init__(self):
        self.position = "近处"
        self.has_box = False
        self.has_bananas = False

    def move_to(self, target):
        if target == "远处":
            print("猴子移动到了远处")
        elif target == "近处":
            print("猴子移动到了近处")
        self.position = target

    def pick_up_box(self):
        if self.position == "近处":
            print("猴子拿起了箱子")
            self.has_box = True
        else:
            print("此处没有箱子，猴子无法拿起")

    def put_down_box(self):
        if self.has_box:
            print("猴子放下了箱子")
            self.has_box = False
        else:
            print("猴子没有箱子，无法放下")

    def climb_box_and_get_bananas(self):
        if self.position == "远处" and not self.has_box:
            print("猴子爬上箱子，成功摘到了香蕉")
            self.has_bananas = True
        else:
            print("猴子无法摘到香蕉")


def main():
    monkey = Monkey()
    # 拿起箱子
    monkey.pick_up_box()
    # 带着箱子移动到远处
    monkey.move_to("远处")
    # 放下箱子
    monkey.put_down_box()
    # 爬上箱子摘香蕉
    monkey.climb_box_and_get_bananas()


if __name__ == "__main__":
    main()
